﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL.Abstract;

namespace DAL.Classes
{
    public class ComentarioDAL : abstractDAL
    {
        public List<Comentario> getComentarioByPostNew(PostNew postNew)
        {
            try
            {
                return (from c in Wiki.Comentarios
                        where c.idPostNew == postNew.idPostNew
                        select c).ToList();
            }
            catch (Exception)
            {
                
                throw;
            }
        }

        public void insertComentario(Comentario comentario)
        {
            try
            {
                Wiki.Comentarios.InsertOnSubmit(comentario);
                Wiki.SubmitChanges();
            }
            catch (Exception)
            {
                
                throw;
            }
        }
    }
}
